package com.spzx.order.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.order.api.domain.OrderInfo;
import com.spzx.order.api.service.RemoteOrderInfoService;
import org.springframework.cloud.openfeign.FallbackFactory;

public class RemoteOrderInfoFallbackFactory implements FallbackFactory<RemoteOrderInfoService> {
    @Override
    public RemoteOrderInfoService create(Throwable cause) {
        return new RemoteOrderInfoService() {
            @Override
            public R<OrderInfo> getOrderInfoByOrderNo(String orderNo, String source) {
                return R.fail("远程调用订单微服务获取订单信息失败"+cause.getMessage());
            }
        };
    }
}
